/***********************************************************************
    filename:   DaterRequestMessage.h
    created:    10/4/2012
    author:     4Ys

    purpose:    Defines base class for Calendar objects
*************************************************************************/
#ifndef _DaterRequestMessage_h_
#define _DaterRequestMessage_h_

#include "DaterGroupEventMap.h"
#include "DaterRecGroup.h"
#include "DaterUser.h"

#include <string>

struct briefGroupJoinMessageInfo
{
	Dater::User* applicant;
	Dater::Group* groupToJoin;
};

class RequestMessage
{
	/*!
	\brief
		An entity class contains 21 year calendars front and back.
	*/
public:
	
	/*!
		\brief
			Constructor for CalendarData class
	*/
	RequestMessage(){}

	/*!
		\brief
			a virtual function to get some values.
	*/
	virtual std::string getMessageTitle() const = 0;
	
	/*!
		\brief
			a virtual function to get some values.
	*/
	virtual std::string getMessageDetail() const = 0;

	/*!
		\brief
			a virtual function to get some values.
	*/
	virtual void accept() = 0;

	/*!
		\brief
			a virtual function to get some values.
	*/
	virtual void refuse() = 0;

	/*!
		\brief
			a virtual function to get some values.
	*/
	virtual std::string getType(){return _type;}

protected:
	std::string _type;
};

class RequestGroupEventResponseMessage : public RequestMessage
{
	/*!
	\brief
		An entity class contains 21 year calendars front and back.
	*/
public:
	/*!
		\brief
			a virtual function to get some values.
	*/
	RequestGroupEventResponseMessage(Dater::GroupEventMap* relatedGroupEventMap);

	/*!
		\brief
			a virtual function to get some values.
	*/
	std::string getMessageTitle() const;

	/*!
		\brief
			a virtual function to get some values.
	*/
	std::string getMessageDetail() const;

	/*!
		\brief
			a virtual function to get some values.
	*/
	void accept();

	/*!
		\brief
			a virtual function to get some values.
	*/
	void refuse();

	/*!
		\brief
			a virtual function to get some values.
	*/
	Dater::GroupEventMap* getRelatedGroupEventMap();

private:
	Dater::GroupEventMap* _relatedGroupEventMap;
};

class RequestGroupJoinMessage : public RequestMessage
{
public:
	RequestGroupJoinMessage(Dater::User* applicant, Dater::Group* groupToJoin, const std::string& reason);

	/*!
		\brief
			a virtual function to get some values.
	*/
	std::string getMessageTitle() const;

	/*!
		\brief
			a virtual function to get some values.
	*/
	std::string getMessageDetail() const;

	/*!
		\brief
			a virtual function to get some values.
	*/
	void accept();

	/*!
		\brief
			a virtual function to get some values.
	*/
	void refuse();

	/*!
		\brief
			a virtual function to get some values.
	*/
	briefGroupJoinMessageInfo getRelatedInfo();

private:
	Dater::User* _applicant;
	Dater::Group* _groupToJoin;
	std::string _reason;
};

#endif